package org.activequant.dao;
import org.activequant.core.domainmodel.InstrumentSpecification;
import org.activequant.core.domainmodel.marketscanner.MarketScanSeriesSpecification;
import org.activequant.core.domainmodel.marketscanner.ScanCriteria;
import org.activequant.core.domainmodel.marketscanner.ScanDataEntity;
import org.activequant.util.exceptions.DaoException;


/**
* Extends the default dao support with scanData series-specific functionality.<br/>
* An interface. Extends the IDaoSupport&lt;T&gt; (where T extends ScanDataEntity). Defines the following methods:
* <ul>
* <li>T[] findByScanCriteria(ScanCriteria scanCriteria) throws DaoException;</li>
* <li>T[] findByMarketScanSeriesSpecification(MarketScanSeriesSpecification marketScanSeriesSpecification) throws DaoException;</li>
* <li>void deleteByScanCriteria(ScanCriteria scanCriteria) throws DaoException;</li>
* <li>void deleteByMarketScanSeriesSpecification(MarketScanSeriesSpecification marketScanSeriesSpecification) throws DaoException;</li>
* </ul>
*  @author Dimitar Misev
*/
public interface IScanDataEntityDao<T extends ScanDataEntity<T>> extends IDaoSupport<T> {
	/**
	 * Returns a set of elements for a given scanCriteria.
	 * @param scanCriteria
	 * @return
	 * @throws DaoException
	 */
	T[] findByScanCriteria(ScanCriteria scanCriteria) throws DaoException;
	
	/**
	 * Returns a set of elements for a given query.
	 * @param marketScanSeriesSpecification
	 * @return
	 * @throws DaoException
	 */
	T[] findByMarketScanSeriesSpecification(MarketScanSeriesSpecification marketScanSeriesSpecification) throws DaoException;
	
	/**
	 * Returns a set of elements for a given query.
	 * @param marketScanSeriesSpecification
	 * @param instrumentSpecification
	 * @return
	 * @throws DaoException
	 */
	T[] findByMarketScanSeriesSpecificationAndInstrumentSpecification(MarketScanSeriesSpecification query, InstrumentSpecification instrumentSpecification) throws DaoException;
	
	/**
	 * Deletes a set of elements for a given scanCriteria.
	 * @param scanCriteria
	 * @throws DaoException
	 */
	void deleteByScanCriteria(ScanCriteria scanCriteria) throws DaoException;
	
	/**
	 * Deletes a set of elements for a given query.
	 * @param marketScanSeriesSpecification
	 * @throws DaoException
	 */
	void deleteByMarketScanSeriesSpecification(MarketScanSeriesSpecification marketScanSeriesSpecification) throws DaoException;
}
